package cn.kgc.alibaba.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: 课工场
 * @Version: v1.0  2023/4/26
 * @Description:
 */
@RestController
@RequestMapping("nacos")
public class NacosController {

    @Value("${server.port}")
    private Integer port;

    @RequestMapping("m1")
    public String method1(Integer id){
        if(id<0){
            throw  new RuntimeException("参数异常");
        }
       return "NacosController port = "+port;
    }


    @RequestMapping("m2")
    public String method2(){
        return "NacosController port = "+port;
    }

}
